<?php
/**
 * View  LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    17-mag-2011
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>

<?php if( count( $this->live_list ) > 0 ) : ?>
            <?php 
            foreach( $this->live_list as $live ): 
                list( $y, $m, $d ) = explode( '-', $live['live_date'] );
            ?>
            <tr class="selectable">
		<td class="date">
		    <h3>
			<b><?php echo $d ?> <?php echo $this->months[sprintf( '%01d', $m )] ?> <?php echo $y ?></b>
			<span><?php echo $this->days[date( 'N', mktime( $hour, $minute, $second, $m, $d, $y ) )] ?></span>
		    </h3>		
		</td>
		<td class="artists">
                <?php 
                $main_artists = null;
                $openingact_artists = null;
                if( count( $live['artists']['main'] ) > 0 ):
                    foreach( $live['artists']['main'] as $artist ):  
                        $main_artists .= $artist['artist_name'] .', ';
                    endforeach;
                endif; ?>
                
                <strong><?php echo substr( $main_artists, 0, -2 ) ?></strong>
                <?php 
                if( count( $live['artists']['openingact'] ) > 0 ):
                    foreach( $live['artists']['openingact'] as $artist ):  
                        $openingact_artists .= $artist['artist_name'] .', ';
                    endforeach; 
                ?>
                <br/> 
                + <span><?php echo substr( $openingact_artists, 0, -2 ) ?></span>
                <?php endif; ?>
		</td>
		<td class="location">
                    <?php echo $live['location_name'] ?>, <strong><?php echo $live['location_city'] ?></strong> (<?php echo $this->province[$live['location_province_id']]['province_short_name'] ?>)
		</td>
		<td class="live-status">
                    <div class="live-status editable">
                        <div class="live-actions" id="<?php echo $live['live_id'] ?>">
                            <span class="<?php echo $this->live_status[$live['live_status_id']]['live_status_mark'] ?>"><?php echo $this->live_status[$live['live_status_id']]['live_status_name'] ?>
                                <a class="edit-status" rel="live-status-options-<?php echo $live['live_id'] ?>">
                                    <img src="/images/admin/sort-default.png"/>
                                </a>
                            </span>
                            <ul class="ddList" id="live-status-options-<?php echo $live['live_id'] ?>">
                                <li><a rel="live-status-options-<?php echo $live['live_id'] ?>" class="dropup">Chiudi</a><h4>Cambia Stato</h4></li>
                                <?php
                                foreach( $this->live_status as $live_status ):
                                    ?>
                                <li class="ddShow">
                                    <a href="javascript:void(0);" rel="{live_id: <?php echo $live['live_id']?>, live_status_id: <?php echo $live_status['live_status_id']?>}" class="select-status <?php echo $live_status['live_status_mark'] ?> <?php echo $live_status['live_status_id'] == $live['live_status_id'] ? 'selected' : ''?>"><?php echo $live_status['live_status_name'] ?></a>
                                </li>
                                    <?php
                                endforeach;
                                ?>
                            </ul>
                        </div>
                    </div>
		</td>
                <td title="Operazioni" class="actions">
                    <span>
                        <a class="view" href="/admin/live/vedi/id/<?php echo $live['live_id']?>">Vedi</a>
                        <a class="edit" href="/admin/live/artisti/id/<?php echo $live['live_id']?>">Edit</a>
                        <a class="del" href="">Canc</a>
                    </span>
                </td>		
	    </tr>
            <?php endforeach;
else:
    ?><tr class="result"><td colspan="5">Nessun elemento presente...</td></tr> <?php	
endif;?>
